namespace SmartSoft.ADP
{
    using System;
    using System.Data;

    public class TaxCodeDataAccess
    {
        private WSTaxCodeDataAccess.WSTaxCodeDataAccess wDataAcess = new WSTaxCodeDataAccess.WSTaxCodeDataAccess();
        private SmartSoft.DAL.TaxCodeDataAccess oDataAcess = new SmartSoft.DAL.TaxCodeDataAccess();

        public TaxCodeDataAccess()
        {
            wDataAcess.Url = wDataAcess.Url.Replace("localhost", AdapterInstance.ServerIp);
        }

        public void TaxCode_Save(DataTable po_Table, DateTime pd_UdtDate)
        {
            if (AdapterInstance.IsRemoteConnected)
            {
                wDataAcess.TaxCode_Save(po_Table, pd_UdtDate);
            }
            else
            {
                oDataAcess.TaxCode_Save(po_Table, pd_UdtDate);
            }
        }

        public string TaxCodeString(DataTable po_Table, DateTime pd_UdtDate)
        {
            if (AdapterInstance.IsRemoteConnected)
            {
                return wDataAcess.TaxCodeString(po_Table, pd_UdtDate);
            }
            else
            {
                return oDataAcess.TaxCodeString(po_Table, pd_UdtDate);
            }
        }
    }
}